﻿using DtoFw;
using DtoFw.Interface;
using DtoFw.Query;
using DtoFw.Result;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SceneEvidenceAPISDK
{
    public class ApiOrgan : Base, IOrgan
    {
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseResult Delete(DeleteDto query)
        {
            return HttpTools.Delete<BaseResult>(query,
                base.GetApiRouter("Delete"));
        }
        /// <summary>
        /// 获取指定机构
        /// </summary>
        /// <param name="OrganId"></param>
        /// <returns></returns>
        public BaseGenericResult<OrganResult> Get(long organId)
        {
            return HttpTools.Get<BaseGenericResult<OrganResult>>(
                base.GetApiRouter("Get", organId.ToString()));
        }
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseResult Post(PostOrgnQuery query)
        {
            return HttpTools.Post<BaseResult>(query,
                 base.GetApiRouter("Post"));
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseResult Put(PostOrgnEditQuery query)
        {
            return HttpTools.Put<BaseResult>(query,
                 base.GetApiRouter("Put"));
        }
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseGenericResult<Pager<OrganResult>> Query(OrganQuery query)
        {
            return HttpTools.Get<BaseGenericResult<Pager<OrganResult>>>(query,
                base.GetApiRouter("Query"));
        }
    }
}
